package com.ruoyi.maintenance.service.impl;

import java.util.List;
import com.ruoyi.common.utils.DateUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import com.ruoyi.maintenance.mapper.MaintenanceAssignMapper;
import com.ruoyi.maintenance.domain.MaintenanceAssign;
import com.ruoyi.maintenance.service.IMaintenanceAssignService;

/**
 * 维护人员分配Service业务层处理
 * 
 * @author silence
 * @date 2025-07-21
 */
@Service
public class MaintenanceAssignServiceImpl implements IMaintenanceAssignService 
{
    @Autowired
    private MaintenanceAssignMapper maintenanceAssignMapper;

    /**
     * 查询维护人员分配
     * 
     * @param id 维护人员分配主键
     * @return 维护人员分配
     */
    @Override
    public MaintenanceAssign selectMaintenanceAssignById(Long id)
    {
        return maintenanceAssignMapper.selectMaintenanceAssignById(id);
    }

    /**
     * 查询维护人员分配列表
     * 
     * @param maintenanceAssign 维护人员分配
     * @return 维护人员分配
     */
    @Override
    public List<MaintenanceAssign> selectMaintenanceAssignList(MaintenanceAssign maintenanceAssign)
    {
        return maintenanceAssignMapper.selectMaintenanceAssignList(maintenanceAssign);
    }

    /**
     * 新增维护人员分配
     * 
     * @param maintenanceAssign 维护人员分配
     * @return 结果
     */
    @Override
    public int insertMaintenanceAssign(MaintenanceAssign maintenanceAssign)
    {
        maintenanceAssign.setCreateTime(DateUtils.getNowDate());
        return maintenanceAssignMapper.insertMaintenanceAssign(maintenanceAssign);
    }

    /**
     * 修改维护人员分配
     * 
     * @param maintenanceAssign 维护人员分配
     * @return 结果
     */
    @Override
    public int updateMaintenanceAssign(MaintenanceAssign maintenanceAssign)
    {
        maintenanceAssign.setUpdateTime(DateUtils.getNowDate());
        return maintenanceAssignMapper.updateMaintenanceAssign(maintenanceAssign);
    }

    /**
     * 批量删除维护人员分配
     * 
     * @param ids 需要删除的维护人员分配主键
     * @return 结果
     */
    @Override
    public int deleteMaintenanceAssignByIds(Long[] ids)
    {
        return maintenanceAssignMapper.deleteMaintenanceAssignByIds(ids);
    }

    /**
     * 删除维护人员分配信息
     * 
     * @param id 维护人员分配主键
     * @return 结果
     */
    @Override
    public int deleteMaintenanceAssignById(Long id)
    {
        return maintenanceAssignMapper.deleteMaintenanceAssignById(id);
    }
}
